(function(){
	angular.module("webApp").directive('contact',["$rootScope", "helper",function($rootScope,helper){
		return {
			restrict:"EA",
			template:"<div id='contactd' class='weui-popup-container'><div class='weui-popup-overlay'></div><div class='weui-popup-modal' style= 'text-align:center;'><i class='aui-iconfont aui-icon-close picker-button   aui-pull-right' style='height:1.5rem;width:1.5rem;' ng-click='closepopup()'></i><br><div style='margin:0 auto;width:6rem;'>长按图片识别图中二维码</div><img ng-src='{{img}}' style='margin:0 auto;width:150px;height:150px;'></div></div>",
			controller: ['$scope', 'authService', 'sessionService', 'dataService', '$compile', 'helper', '$templateCache','$state','ERP_CONFIG','$location','cacheService',function($scope, authService, sessionService, dataService, $compile, helper, $templateCache,$state,ERP_CONFIG,$location,cacheService){
				this.popup=function(){
					$("#contactd").popup();
					$scope.img="http://yy.dhfeng.com/static/uploads/2016-11-30/deac5fd8-f0d3-4fe3-a3e4-2f1ce09a0841.png";

				}
				$scope.closepopup=function(){
					$.closePopup()
				}
			}],
			link:function(scope, elem, attrs, ctr){
				scope.$on('event:contactBusiness',function(){
					ctr.popup();
				})
			}
		}
	}]);
})();